package com.chao.rsa2demo.encrypt;

import com.chao.rsa2demo.encrypt.constant.ErrorEnum;

/**
 * @author: cjp
 * @create: 2024-11-12 10:31
 * @description: TODO
 */
public class RSAException extends Exception {

    private static final long serialVersionUID = -238091758285157331L;

    private String errCode;
    private String errMsg;

    public RSAException() {
        super();
    }

    public RSAException(String message, Throwable cause) {
        super(message, cause);
    }

    public RSAException(ErrorEnum messageEnum, Throwable cause) {
        super(messageEnum.getErrMsg(), cause);
    }

    public RSAException(String message) {
        super(message);
    }

    public RSAException(ErrorEnum messageEnum) {
        super(messageEnum.getErrMsg());
    }

    public RSAException(Throwable cause) {
        super(cause);
    }

    public RSAException(String errCode, String errMsg) {
        super(errCode + ":" + errMsg);
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    public String getErrCode() {
        return this.errCode;
    }

    public String getErrMsg() {
        return this.errMsg;
    }
}